#include <stdio.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char **argv){
	int sockfd;
	
	short int portnumber=80;
	unsigned int addr_size;
	struct sockaddr_in server_addr;

	if((sockfd=socket(AF_INET,SOCK_STREAM,0))==-1)/*建立SOCKET连接*/
	{	
		perror("Socket Error");
		exit(1);
	}
	printf("%d\n",sockfd);
	return 0;
	bzero(&server_addr,sizeof(server_addr));
    server_addr.sin_family=PF_INET;
    server_addr.sin_port=htons(portnumber);
    server_addr.sin_addr.s_addr=INADDR_ANY;

	if (bind(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr))==-1){
		perror("bind");
		exit(1);
	}
	if (listen(sockfd,5)==-1){
		perror("listen");
		exit(1);
	}
	addr_size=sizeof(server_addr);
	accept(sockfd, (struct sockaddr *)&server_addr, &addr_size); 
	return 0;
}
